package routes

import (
	"intelli-dl-online-logo-go/controller"

	"github.com/gin-gonic/gin"
)

// InitRoutes 初始化所有路由
func InitRoutes(r *gin.Engine, userController *controller.UserController, verifyController *controller.VerifyController) {
	// 添加一个简单的测试路由
	r.GET("/", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "Welcome to Intelli-DL Online Logo Service",
			"env":     c.GetString("env"),
		})
	})

	// 注册API路由组
	registerAPIRoutes(r, userController, verifyController)
}

// registerAPIRoutes 注册API路由组
func registerAPIRoutes(r *gin.Engine, userController *controller.UserController, verifyController *controller.VerifyController) {
	// API路由组
	api := r.Group("/api")
	{
		// 注册用户相关路由
		registerUserRoutes(api, userController)

		// 注册验证码相关路由
		registerVerifyRoutes(api, verifyController)
	}
}
